package domain;

import utils.CommandAnalyzer;
import enums.Frequency;
import basic.Transaction;

//@author A0098891H
public class Income extends Transaction {

	public static final String DEFAULT_PAYER = "";
	public static final Frequency DEFAULT_FREQUENCY = Frequency.MONTHLY;
	
	//attributes
	
	/**
	 * 
	 */
	public Income()
	{
		super();
		this._frequency = Frequency.MONTHLY;
	}
	/**
	 * @param inc
	 */
	public Income(Income inc)
	{
		this.set(inc);
	}
	
	/**
	 * 
	 * @param inc
	 * @Precondition 
	 * @Postcondition 
	 */
	public void set(Income inc)
	{
		super.set(inc);
		this.set_frequency(inc._frequency);
	}
	
	/**
	 *
	 * @see java.lang.Object#toString()
	 * @return
	 * @Precondition 
	 * @Postcondition 
	 */
	public String toString()
	{

		return  _name + "," + _amount + "," + _id
				+ "," + CommandAnalyzer.PARAM_PARTYINVOLVED + _partyInvolved
				+ "," + CommandAnalyzer.PARAM_MEMBER + _byMem 
				+ "," + CommandAnalyzer.PARAM_DATE + _date.toString() 
				+ "," + CommandAnalyzer.PARAM_FREQUENCY + _frequency
				+ "," + CommandAnalyzer.PARAM_COMMENTS + _comments
				+ "," + CommandAnalyzer.PARAM_TOTALAMOUNT + _totalAmount
				+ "," + CommandAnalyzer.PARAM_UPDATEDATE + _lastUpdateDate;
		
	}

}
